package com.viknix.threadpool.manager.autoconfigure;

import com.viknix.threadpool.manager.client.http.HttpAgent;
import com.viknix.threadpool.manager.client.http.HttpClientUtil;
import com.viknix.threadpool.manager.client.http.ServerHttpAgent;
import lombok.SneakyThrows;
import okhttp3.OkHttpClient;
import org.springframework.context.annotation.Bean;

import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.util.concurrent.TimeUnit;

/**
 * @Author: Dongqi
 * @Date: 2021/10/22 15:33
 * @Version 1.0
 * @Description: 远程调用配置类
 */
public class HttpClientConfig {

    /**
     * 自动配置（线程池注册）
     *
     * @param properties
     * @return
     */
    @Bean
    public HttpAgent httpAgent(TpmConfigProperties properties) {
        return new ServerHttpAgent(properties.assembleConfigServiceProperties());
    }
}
